package cn.edu.tju.elm.controller.dto;

import cn.edu.tju.elm.model.VirtualWallet;
import java.math.BigDecimal;

/**
 * 钱包信息响应DTO
 */
public class WalletInfoResponse {
    
    /**
     * 钱包ID
     */
    private Long walletId;
    
    /**
     * 用户ID
     */
    private Long userId;
    
    /**
     * 可用余额
     */
    private BigDecimal balance;
    
    /**
     * 冻结金额
     */
    private BigDecimal frozenAmount;
    
    /**
     * 透支额度
     */
    private BigDecimal overdraftLimit;
    
    /**
     * 已透支金额
     */
    private BigDecimal overdraftUsed;
    
    /**
     * 剩余透支额度
     */
    private BigDecimal remainingOverdraft;
    
    /**
     * 可用余额（含透支）
     */
    private BigDecimal availableBalance;
    
    /**
     * 总资产
     */
    private BigDecimal totalAssets;
    
    /**
     * 累计奖励
     */
    private BigDecimal bonusAmount;
    
    /**
     * 是否VIP
     */
    private Boolean isVip;
    
    /**
     * 钱包状态
     */
    private String status;
    
    /**
     * 应付利息
     */
    private BigDecimal interestDue;

    public WalletInfoResponse() {
    }

    public WalletInfoResponse(VirtualWallet wallet) {
        this.walletId = wallet.getId();
        this.userId = wallet.getUser() != null ? wallet.getUser().getId() : null;
        this.balance = wallet.getBalance();
        this.frozenAmount = wallet.getFrozenAmount();
        this.overdraftLimit = wallet.getOverdraftLimit();
        this.overdraftUsed = wallet.getOverdraftUsed();
        this.remainingOverdraft = wallet.getOverdraftLimit().subtract(wallet.getOverdraftUsed());
        this.availableBalance = wallet.getAvailableBalance();
        this.totalAssets = wallet.getTotalAssets();
        this.bonusAmount = wallet.getBonusAmount();
        this.isVip = wallet.getVip();
        this.status = wallet.getStatus();
        this.interestDue = wallet.calculateInterest();
    }

    // Getters and Setters
    public Long getWalletId() {
        return walletId;
    }

    public void setWalletId(Long walletId) {
        this.walletId = walletId;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public BigDecimal getBalance() {
        return balance;
    }

    public void setBalance(BigDecimal balance) {
        this.balance = balance;
    }

    public BigDecimal getFrozenAmount() {
        return frozenAmount;
    }

    public void setFrozenAmount(BigDecimal frozenAmount) {
        this.frozenAmount = frozenAmount;
    }

    public BigDecimal getOverdraftLimit() {
        return overdraftLimit;
    }

    public void setOverdraftLimit(BigDecimal overdraftLimit) {
        this.overdraftLimit = overdraftLimit;
    }

    public BigDecimal getOverdraftUsed() {
        return overdraftUsed;
    }

    public void setOverdraftUsed(BigDecimal overdraftUsed) {
        this.overdraftUsed = overdraftUsed;
    }

    public BigDecimal getRemainingOverdraft() {
        return remainingOverdraft;
    }

    public void setRemainingOverdraft(BigDecimal remainingOverdraft) {
        this.remainingOverdraft = remainingOverdraft;
    }

    public BigDecimal getAvailableBalance() {
        return availableBalance;
    }

    public void setAvailableBalance(BigDecimal availableBalance) {
        this.availableBalance = availableBalance;
    }

    public BigDecimal getTotalAssets() {
        return totalAssets;
    }

    public void setTotalAssets(BigDecimal totalAssets) {
        this.totalAssets = totalAssets;
    }

    public BigDecimal getBonusAmount() {
        return bonusAmount;
    }

    public void setBonusAmount(BigDecimal bonusAmount) {
        this.bonusAmount = bonusAmount;
    }

    public Boolean getIsVip() {
        return isVip;
    }

    public void setIsVip(Boolean isVip) {
        this.isVip = isVip;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public BigDecimal getInterestDue() {
        return interestDue;
    }

    public void setInterestDue(BigDecimal interestDue) {
        this.interestDue = interestDue;
    }
}
